<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Model;

class Roles extends Model
{
    protected $table = 'roles';
    public $timestamps = false;
    protected $fillable = [
        'title', 'description', 'rules'
    ];
    protected $casts = [
        'rules' => 'array',
    ];


    /**
     * 获取所有角色
     * @return mixed
     */
    protected function getRoles(){
        return $this->get(['title','id'])->pluck('title','id');
    }



}
